package com.shensi.api.admin.client.station;

import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.station.dto.FinanceStatementQueryForm;
import com.shensi.api.admin.domian.station.dto.GoodsForm;
import com.shensi.api.admin.domian.station.dto.GoodsQueryForm;
import com.shensi.common.core.annotation.Log;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.enums.BusinessType;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysLogininforClientFallBack.class)
@Component
public interface GoodsServiceClient {


    @PostMapping("/goods")
    public AjaxResult add(@Valid @RequestBody GoodsForm goodsForm);

    @PutMapping("/goods/{id}")
    public AjaxResult update(@PathVariable("id") Long id, @RequestBody GoodsForm goodsForm);

    @GetMapping(value = "/goods/{id}")
    public AjaxResult get(@PathVariable("id") Long id);

    @DeleteMapping("/goods/{ids}")
    public AjaxResult delete(@PathVariable("ids") List<Long> ids);

    @GetMapping("/goods/page")
    public TableDataInfo page(@SpringQueryMap GoodsQueryForm queryForm);


    @PutMapping("/goods/id/{id}/status/{status}")
    public AjaxResult updateStatus(@PathVariable("id") Long id, @PathVariable("status") Integer status);

}
